package com.zifeng.study.service.impl;

import com.zifeng.study.bean.User;
import com.zifeng.study.service.OrderService;
import com.zifeng.study.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @description 订单service实现类
 */
@Service
public class OrderServiceImpl implements OrderService {

    @DubboReference(version = "${demo.service.version}")
    UserService userService;
    @Override
    public String createOrder(long userId, String product) {
        User user = userService.getUserById(userId);
        return "用户【" + user.getUserName() + "】创建【" + product + "】购买订单成功！";
    }
    @Override
    public User getOrderUserInfo(long oId) {
       User user = userService.getUserInfo(oId);
        return user;
    }
}
